<!-- PAGE CONTENT WRAPPER -->
<div class="page-content-wrap">

    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="col-md-11" style="text-align: center;">
                        <h3 class="panel-title">{{'量表题目列表' | dyLanguage}}</h3>
                        <button class="btn btn-info btn-right" ng-click="save()"><i class="fa fa-check"></i>{{'保存全部' | dyLanguage}}</button>
                        <button class="btn btn-info btn-right" ng-click="addTopic()"><i class="fa fa-plus"></i>{{'新增题目' | dyLanguage}}</button>
                        <button class="btn btn-info btn-right" ng-click="updateConfig()"><i class="fa fa-edit"></i>{{'配置基本参数' | dyLanguage}}</button>
                    </div>
                    <div class="col-md-1">
                        <js-xls onread="read" onerror="error" class="fileinput btn-info" title="上传文件"></js-xls>
                    </div>
                    <div class="col-md-2">
                        <js-xls onread="readWB" onerror="error" class="fileinput btn-info" title="上传微帮格式文件"></js-xls>
                    </div>
                </div>
                <div class="panel-body" style="font-weight: bold;">
                    <p>{{'本页面可对系统内的量表题目组进行查询、新增、编辑等管理操作。' | dyLanguage}}</p>
                </div>
                <div class="panel-body table-responsive" ng-repeat="gaugeTopic in currentGaugeTopicGroup.gaugeTopics | orderBy:'itemCode'">
                    <p>
                        <label style="margin: 0 10px;">{{gaugeTopic.itemCode}}/{{currentGaugeTopicGroup.gaugeTopics.length}}</label>
                        <label style="margin: 0 10px;">{{gaugeTopic.content}}</label>
                        <label style="margin: 0 10px;">({{'类型' | dyLanguage}}:{{gaugeTopic.type | EnumFilter:'GaugeTopicTypeEnum'}})</label>
                    </p>
                    <table class="table table-bordered" ng-show="gaugeTopic.type != 'INPUT'">
                        <thead>
                        <tr>
                            <th width="10%">{{'选项' | dyLanguage}}</th>
                            <th width="10%">{{'分值' | dyLanguage}}</th>
                            <th>{{'内容' | dyLanguage}}</th>
                            <th>{{'选项图片' | dyLanguage}}</th>
                            <th width="10%">{{'下一题' | dyLanguage}}</th>
                            <th width="10%">{{'操作' | dyLanguage}}</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="attribute in gaugeTopic.attributes | orderBy:'sort'">
                            <td>{{attribute.sort}}</td>
                            <td>{{attribute.score}}</td>
                            <td>{{attribute.content}}</td>
                            <td><img ng-src="{{attribute.picture | faceUrl}}" width="100px"></td>
                            <td>{{attribute.nextItemCode}}</td>
                            <td>
                                <div class="btn-group">
                                    <a href="javascript:void(0);" data-toggle="dropdown" class="btn btn-primary dropdown-toggle">{{'记录操作' | dyLanguage}}<span class="caret"></span></a>
                                    <ul class="dropdown-menu" role="menu" style="text-align: center;">
                                        <li ng-click="editAttribute(attribute)"><a>{{'编辑选项' | dyLanguage}}</a></li>
                                        <li ng-click="deleteAttribute(gaugeTopic,attribute)"><a>{{'删除选项' | dyLanguage}}</a></li>
                                    </ul>
                                </div>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div style="text-align: center;">
                        <button class="btn btn-danger" ng-click="deleteTopic(gaugeTopic)"><i class="fa fa-times"></i>{{'删除题目' | dyLanguage}}</button>
                        <button class="btn btn-primary" ng-click="editTopic(gaugeTopic)"><i class="fa fa-edit"></i>{{'编辑题目' | dyLanguage}}</button>
                        <button class="btn btn-primary" ng-click="addTopicTemp(gaugeTopic)"><i class="fa fa-plus"></i>{{'新增题目（按当前配置）' | dyLanguage}}</button>
                        <button class="btn btn-primary" ng-click="addAttribute(gaugeTopic)"><i class="fa fa-plus"></i>{{'新增选项' | dyLanguage}}</button>
                        <button class="btn btn-primary" ng-click="save()"><i class="fa fa-check"></i>{{'保存当前' | dyLanguage}}</button>
                    </div>
                </div>
                <div class="panel-footer">
                    <div class="col-md-11" style="text-align: center;">
                        <button class="btn btn-info btn-right" ng-click="save()"><i class="fa fa-check"></i>{{'保存全部' | dyLanguage}}</button>
                        <button class="btn btn-info btn-right" ng-click="addTopic()"><i class="fa fa-plus"></i>{{'新增题目' | dyLanguage}}</button>
                        <button class="btn btn-info btn-right" ng-click="updateConfig()"><i class="fa fa-edit"></i>{{'配置基本参数' | dyLanguage}}</button>
                    </div>
                    <div class="col-md-1">
                        <js-xls onread="read" onerror="error" class="fileinput btn-info" title="{{'上传文件' | dyLanguage}}"></js-xls>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- END PAGE CONTENT WRAPPER -->
</div>
